home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-26 | 548 b | 27 lines | [TEXT/EDIT] |
- // Example plot
-
- t = (0:10:.05)';
- x = exp (-0.5*t) .* (cos (2*pi*3*t) + sin (2*pi*7*t));
- X = fft (x);
- rfile faxis
- freq = faxis (X, .05, 3);
- mag = abs (X);
- rfile angle
- phase = angle (X);
- pstart (1,2,"Mac");
- plfont(2); // Roman font
- plwid(2); // line width
-
- ptitle ("Magnitude of FFT");
- xlabel ("Frequency #gw (Hertz)"); // omega
- plot ([freq,mag]);
-
- ptitle ("Angle (tan#u-1#d(imag/real)) of FFT");
- xlabel ("Frequency #gw (Hertz)");
- ylabel ("Angle (radians)");
- plot ([freq,phase]);
- pause();
-
- //send Postscript output to p3.ps
- //plprint ("p3.ps");
-